package classtest;

import classtest_domain.Rectangle;

/**
 * @version 1.0
 * @auther liquan
 * @date 2025/3/18 13:57
 * @description
 */
public class Demo2 {
    public static void main(String[] args) {
        // 创建Rectangle对象并使用setter方法给属性赋值
        Rectangle rectangle = new Rectangle();
        rectangle.setChang(4);
        rectangle.setKuan(2);

        System.out.println("长：" + rectangle.getChang());
        System.out.println("宽：" + rectangle.getKuan());
        System.out.println("面积：" + rectangle.getArea());
        System.out.println("周长：" + rectangle.getPerimeter());

        // 再次修改长宽为原来的两倍
        rectangle.setChang(rectangle.getChang() * 2);
        rectangle.setKuan(rectangle.getKuan() * 2);

        System.out.println(rectangle.getInfo());
    }
}
